#include <nav_msgs/OccupancyGrid.h>
#include <ros/ros.h>

int main(int argc, char** argv)
{
    ros::init(argc, argv, "map");
    ros::Time::init();
    ros::Rate rate(10);
    ros::NodeHandle nh;
    ros::Publisher pub = nh.advertise<nav_msgs::OccupancyGrid>("/map", 10);

    while (ros::ok()) {
        nav_msgs::OccupancyGrid msg;
        msg.header.frame_id = "map";
        msg.header.stamp = ros::Time::now();
        msg.info.resolution = 1;
        msg.info.origin.position.x = 0;
        msg.info.origin.position.y = 0;
        msg.info.origin.position.z = 0;
        msg.info.width = 4;
        msg.info.height = 2;
        msg.data.resize(4 * 2);
        msg.data[0] = 100;
        msg.data[1] = 100;
        msg.data[2] = 0;
        msg.data[3] = -1;
        msg.data[4] = 0;
        msg.data[5] = 0;
        msg.data[6] = 0;
        msg.data[7] = 0;
        pub.publish(msg);
        rate.sleep();
    }
    return 0;
}
